--[[/**
-- * 
 击退到战场边缘则眩晕
-- */]]

---@class BuffEffect312100 : BaseBuffEffect
BuffEffect312100 = ClientFight.CreateClass("BuffEffect312100", ClientFight.BaseBuffEffect)
local t = BuffEffect312100

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local distance = buff.buffBean.f_BuffEffectValue[1];
    local effectId = buff.buffBean.f_BuffEffectValue[2];

    local target = buff.target;
    local skill =  buff.addParameters[2];


    local out = FighterManager.changePosition(fight, target, 0, target.position.x + skill.targetDirection * toRatio(distance),
            target.position.y, 0, true, true, true);
    SkillRoleMgr.savePathFile( "[" .. fight.frame .. "][EFFECT]Fighter " .. target.fighterId .. " Buff" .. buff.modelId .. " 击退到" .. target.position);
    buff.target.moveTarget = nil;
    buff.target.moveDirection = 0;
    buff.target.moveAction = nil;
    buff.target.movePosition = nil;
    if (out) then
        BuffManager.addBuff(fight, buff.skill, buff.source, target, false, effectId, 1);
    end
    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end

t.New()